<?php
namespace App\Common\Lib\Hyperf\QueryExtend\Contracts;

use App\Common as com;
use App\Common\Lib\Hyperf\QueryExtend\Contracts\QueryCacheModuleInterface as nameQueryCacheModuleInterface;

interface QueryCacheModuleInterface
{
	/**
	 * 为查询生成简单的唯一缓存键。
	 * Generate the plain unique cache key for the query.
	 *
	 * @param  string  $method
	 * @param  string|null  $id
	 * @param  string|null  $appends
	 * @return string
	 */
	public function generatePlainCacheKey(string $method = 'get', $id = null, $appends = null): string;

	/**
	 * Get the query cache callback.
	 *
	 * @param  string  $method
	 * @param  array  $columns
	 * @param  string|null  $id
	 * @return \Closure
	 */
	public function getQueryCacheCallback(string $method = 'get', $columns = ['*'], $id = null);
}
